<!DOCTYPE html>
<html>
  <head>
    <title> 账单</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
  </head>
  <body>
    <a href="/logout" class="btn-default">退出</a>
    <h1> 账单</h1>
    <table class="table table-bordered table-hover ">
      <caption>账单列表</caption>
      <tr >
        <th>序号</th>
        <th>事项</th>
        <th>时间</th>
        <th>类型</th>
        <th>金额</th>
        <th>备注</th>
      </tr>
      <% accounts.forEach(item=>{ %>
        <tr class="<%= item.type === '支出' ? 'danger' : 'success' %>">
          <td><%= item.id %></td>
          <td><%= item.event %></td>
          <td><%= item.time %></td>
          <td><%= item.type %></td>
          <td><%= item.money %></td>
          <td><%= item.remark %>
            <a class="btn btn-default" href="/api/account/<%=item.id%>" role="button">×</a>
          </td>
        </tr>
        <%})%>

    </table>

  </body>
</html>
